//**************************************************************//
//  Effect File exported by RenderMonkey 1.6
//
//  - Although many improvements were made to RenderMonkey FX  
//    file export, there are still situations that may cause   
//    compilation problems once the file is exported, such as  
//    occasional naming conflicts for methods, since FX format 
//    does not support any notions of name spaces. You need to 
//    try to create workspaces in such a way as to minimize    
//    potential naming conflicts on export.                    
//    
//  - Note that to minimize resulting name collisions in the FX 
//    file, RenderMonkey will mangle names for passes, shaders  
//    and function names as necessary to reduce name conflicts. 
//**************************************************************//

//--------------------------------------------------------------//
// SkyDome
//--------------------------------------------------------------//
//--------------------------------------------------------------//
// Pass 0
//--------------------------------------------------------------//
string SkyDome_Pass_0_Model : ModelData = "c:\\program files\\ati research inc\\rendermonkey 1.62\\Examples\\Media\\Models\\SkyDome.3ds";

float4x4 matViewProjection : ViewProjection;
texture gradientTexture : DiffuseMap; // Variable declaration
float timeOfDay;

struct VS_OUTPUT
{
    float4 Pos      : POSITION;
    float2 TexCoord : TEXCOORD0;
};

VS_OUTPUT SkyDome_Pass_0_Vertex_Shader_vs_main(float4 Pos : POSITION)
{
    VS_OUTPUT Out = (VS_OUTPUT)0;
    Out.Pos = mul(Pos, matViewProjection); // transform Position
    
    Out.TexCoord.x = timeOfDay;
    Out.TexCoord.y = 1-Pos.y;
    
    return Out;
}

sampler SkyTex = sampler_state
{
   Texture = (gradientTexture);
};

float4 SkyDome_Pass_0_Pixel_Shader_ps_main(float2 skyMap : TEXCOORD0) : COLOR
{
   //return float4(1.0f, 0.0f, 1.0f, 0.0f);
   return tex2D(SkyTex, skyMap);
}
//--------------------------------------------------------------//
// Technique Section for SkyDome
//--------------------------------------------------------------//
technique SkyDome
{
   pass Pass_0
   {
	  MinFilter[0] = LINEAR;
      MagFilter[0] = LINEAR;
      MipFilter[0] = LINEAR;
      AddressU[0]  = WRAP;
      AddressV[0]  = CLAMP;
   
      VertexShader = compile vs_2_0 SkyDome_Pass_0_Vertex_Shader_vs_main();
      PixelShader = compile ps_2_0 SkyDome_Pass_0_Pixel_Shader_ps_main();
   }

}

